import request from "@/utils/request"

// 登录请求参数类型
type ExamParamsType = {
    id: number | string;
    level: number | string;
    subjectId: number | string;
    pageIndex: number;
    pageSize: number,

}
//请求编辑参数类型
type ExamResponseType<T> = {
    total: number;
    list: T[]
}
//返回值类型
export type ExamType = {
    id: number;
    name: string;
    questionCount: number;
    score: number;
    createTime: string;
    createUser: string;
    subjectId: number;
    paperType: number;
    frameTextContentId: number;
    // subject: string
}
export function examPage(data: ExamParamsType) {
    return request.post<ExamResponseType<ExamType>>("/api/admin/exam/paper/page", data)
}
//添加试卷接口
export type ExamAddParamsType ={
    id:null;
    level:number|string;
    subjectId:number|string;
    paperType:number|string;
    levelName:string;
    name:string;
    suggestTime:number|string
}
//试卷添加/编辑接口
export function examAdd(data: ExamAddParamsType) {
    return request.post<null>("/api/admin/exam/paper/edit", data)
}